package com.bit.strongbaby;

import java.util.Timer;
import java.util.TimerTask;

import android.os.Bundle;
import android.os.Handler;
import android.app.Activity;
import android.content.ContentValues;
import android.content.Context;
import android.content.Intent;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;

public class MainActivity extends Activity {
	Mainani mami;
	private TimerTask mTask;
	private Timer mTimer;
	Handler mhandler = null;
	Handler mhandler2 = null;
	Thread t1;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		mami = (Mainani) findViewById(R.id.mani);
		mhandler = new Handler();

		t1 = new Thread(new Runnable() {
			public void run() {
				mhandler.postDelayed(new Runnable() {
					public void run() {
						mami.setVisibility(View.VISIBLE);
					}
				}, 1000);
				Log.d("myTask", "run2()");
				mami.setVisibility(View.INVISIBLE);
				mhandler.postDelayed(new Runnable() {
					public void run() {
						mami.setVisibility(View.INVISIBLE);

					}
				}, 2000);
				mhandler.postDelayed(new Runnable() {
					public void run() {
						mami.setVisibility(View.VISIBLE);
						Log.d("myTask", "run1()");
					}
				}, 3000);
				mhandler.postDelayed(new Runnable() {
					public void run() {
						mami.setVisibility(View.INVISIBLE);
					}
				}, 4000);
				mhandler.postDelayed(new Runnable() {
					public void run() {
						mami.setVisibility(View.VISIBLE);
						Log.d("myTask", "run3()");
					}
				}, 5000);
				mhandler.postDelayed(new Runnable() {
					public void run() {
						mami.setVisibility(View.INVISIBLE);
					}
				}, 6000);
				mhandler.postDelayed(new Runnable() {
					public void run() {
						mami.setVisibility(View.VISIBLE);
					}
				}, 7000);
				mhandler.postDelayed(new Runnable() {
					public void run() {
						mami.setVisibility(View.INVISIBLE);
					}
				}, 8000);
				mhandler.postDelayed(new Runnable() {
					public void run() {
						mami.setVisibility(View.VISIBLE);
					}
				}, 9000);
				mhandler.postDelayed(new Runnable() {
					public void run() {
						mami.setVisibility(View.INVISIBLE);
					}
				}, 10000);

			}
		});
		t1.start();

		ImageView img1 = (ImageView) findViewById(R.id.imageView123);
		ImageView img2 = (ImageView) findViewById(R.id.imageView2);

		img1.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				Intent intent = new Intent(getBaseContext(), MenuActivity.class);
				startActivity(intent);
				finish();
			}
		});

		img2.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				Intent intent = new Intent(getBaseContext(), MenuActivity.class);
				startActivity(intent);
				finish();
			}
		});

		
	}

	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.main, menu);
		return true;
	}

}
